import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DataScheduledVO, DataScheduledForm, DataScheduledQuery } from '@/api/bclt/dataScheduled/types';

/**
 * 查询手环-指标数据-定时测量列表
 * @param query
 * @returns {*}
 */

export const listDataScheduled = (query?: DataScheduledQuery): AxiosPromise<DataScheduledVO[]> => {
  return request({
    url: '/bclt/dataScheduled/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询手环-指标数据-定时测量详细
 * @param id
 */
export const getDataScheduled = (id: string | number): AxiosPromise<DataScheduledVO> => {
  return request({
    url: '/bclt/dataScheduled/' + id,
    method: 'get'
  });
};

/**
 * 新增手环-指标数据-定时测量
 * @param data
 */
export const addDataScheduled = (data: DataScheduledForm) => {
  return request({
    url: '/bclt/dataScheduled',
    method: 'post',
    data: data
  });
};

/**
 * 修改手环-指标数据-定时测量
 * @param data
 */
export const updateDataScheduled = (data: DataScheduledForm) => {
  return request({
    url: '/bclt/dataScheduled',
    method: 'put',
    data: data
  });
};

/**
 * 删除手环-指标数据-定时测量
 * @param id
 */
export const delDataScheduled = (id: string | number | Array<string | number>) => {
  return request({
    url: '/bclt/dataScheduled/' + id,
    method: 'delete'
  });
};
